<?php

session_start();
if(!isset($_SESSION["secretnum"])) {
$secretnum=rand(1,100);
	$tries=0;
$_SESSION["tries"]=$tries;
$_SESSION["secretnum"]=$secretnum;	
}

if (isset($_REQUEST["guess"]) && isset($_SESSION["secretnum"])) {
$guess=$_REQUEST["guess"];
$secretnum=$_SESSION["secretnum"];
$tries=$_SESSION["tries"];
$tries++;
$_SESSION["tries"]=$tries;

if ($guess<$secretnum) {	
	echo "too low";	
}
else if ($guess>$secretnum) {
	echo "too high";	
}
else {
echo "Graz";
echo "<BR>";
echo "tries : $tries";
}

}

?>

<form action="numberguesser.php">
Intast her: <input type="text" name="guess" />
<input type="submit" value="ok" />
</form>